Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gazelle: detect any directory with /test in path as test package #297

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

kusaeva
Copy link
Contributor

@kusaeva kusaeva commented Aug 29, 2024

We have not very java-like structure in our monorepo:
Screen Shot 2024-08-29 at 16 53 15
So current func IsTestPackage doesn't detect our tests as tests and we have found MULTIPLE results in rule index error because of the same package in test classes.
We propose the fix, so files in packages like //common/test will also fit as test packages.

@illicitonion
Copy link
Collaborator

Thanks for the contribution!

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you add a couple of new test-cases to https://github.com/bazel-contrib/rules_jvm/blob/main/java/gazelle/private/java/java_test.go (one for test at the end, one for testutil in the middle) to make sure this behaviour doesn't regress? Otherwise, happy to merge! Thanks!

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

@illicitonion illicitonion enabled auto-merge (squash) September 3, 2024 19:34
@illicitonion illicitonion merged commit 43d61cb into bazel-contrib:main Sep 3, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants